<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>无标题文档</title>
        <script type="text/javascript" src="../angular.min.js"></script>
    </head>
    <body ng-app="valueExample">
    <script>
        angular.module('valueExample', [])
                .controller('ExampleController', ['$scope', function($scope) {
                    $scope.names = ['pizza', 'unicorns', 'robots'];
                    $scope.my = { favorite: 'unicorns' };
                }]);
    </script>
    <form ng-controller="ExampleController">
        <h2>Which is your favorite?</h2>
        <label ng-repeat="name in names">
            {{name}}
            <input type="radio"
                   ng-model="my.favorite"
                   ng-value="name"
                   id="{{name}}"
                   name="favorite">
        </label>
        <div>You chose {{my.favorite}}</div>
    </form>
       
    </body>
</html>